package com.zhu.wx.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 返回的消息
 */
@TableName("t_res_msg")
@Table(name = "t_res_msg")
@Entity
public class ResMsg {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Long id;
    /**
     * 接收方微信号
     */
    @Transient
    @TableField(exist = false)
    private String toUserName;
    /**
     * 回复方微信号
     */
    @Transient
    @TableField(exist = false)
    private String fromUserName;
    /**
     * (数据库)消息创建时间
     */
    private Date createTime;
    /**
     * 消息类型
     */
    private String msgType;
    /**
     * 文本消息
     */
    private String content;
    /**
     * 链接消息
     */
    private String mediaId;
    /**
     * 视频/音乐/图文消息标题
     */
    private String title;
    /**
     * 视频/音乐/图文消息描述
     */
    private String description;
    /**
     * 音乐消息音乐链接
     */
    @Column(name = "music_url")
    @TableField(value = "music_url")
    private String musicURL;
    /**
     * 高质量音乐链接，WIFI环境优先使用该链接播放音乐
     */
    @Column(name = "h_q_music_url")
    @TableField(value = "h_q_music_url")
    private String hQMusicUrl;
    /**
     * 缩略图的媒体id，通过素材管理中的接口上传多媒体文件，得到的id
     */
    private String thumbMediaId;
    /**
     * 图文消息列表
     */
    @Transient
    @TableField(exist = false)
    private List<ArticleMsg> articleMsgList;

    public List<ArticleMsg> getArticleMsgList() {
        return articleMsgList;
    }

    public void setArticleMsgList(List<ArticleMsg> articleMsgList) {
        this.articleMsgList = articleMsgList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getMusicURL() {
        return musicURL;
    }

    public void setMusicURL(String musicURL) {
        this.musicURL = musicURL;
    }

    public String gethQMusicUrl() {
        return hQMusicUrl;
    }

    public void sethQMusicUrl(String hQMusicUrl) {
        this.hQMusicUrl = hQMusicUrl;
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }
}
